package com.liwalla.domain;

import javax.persistence.Entity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import org.springframework.roo.addon.entity.RooEntity;
import java.math.BigInteger;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.springframework.format.annotation.DateTimeFormat;
import com.liwalla.domain.type.EGender;
import javax.persistence.Enumerated;
import com.liwalla.domain.Parent;
import javax.persistence.ManyToOne;
import javax.persistence.JoinColumn;

@Entity
@RooJavaBean
@RooToString
@RooEntity
public class Kid {

    @NotNull
    private BigInteger id;

    @NotNull
    @Size(max = 30)
    private String firstName;

    @NotNull
    @Size(max = 50)
    private String lastName;

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "S-")
    private Date birthDate;

    @Size(max = 100)
    private String birthCity;

    @Enumerated
    private EGender gender;

    @NotNull
    @ManyToOne(targetEntity = Parent.class)
    @JoinColumn
    private Parent parente;
}
